﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Policlinica
{
    public class Patient : BusinessObjectBase
    {
        private string _surname;
        private string _name;
        private string _middlename;
        private string _sex;
        private DateTime _birth;
        private Address _Address;
        private InsurancePolis _InsurancePolis;
    

        public Patient()
        {
            this._Address = default(Address);
            this._InsurancePolis = default(InsurancePolis);
        }

        public Patient(int id, bool isDeleted, string surname, string name, string middlename, string sex, DateTime birth,
            Address address, InsurancePolis insurancePolis):base(id, isDeleted)
        {
            _surname = surname;
            _name = name;
            _middlename = middlename;
            _sex = sex;
            _birth = birth;
            _Address = address;
            _InsurancePolis = insurancePolis;
        }

        public Patient(string surname, string name, string middlename, string sex, DateTime birth,
            Address address, InsurancePolis insurancePolis)
        {
            _surname = surname;
            _name = name;
            _middlename = middlename;
            _sex = sex;
            _birth = birth;
            _Address = address;
            _InsurancePolis = insurancePolis;
        }


        public string Surname
        {
            get
            {
                return this._surname;
            }
            set
            {
                if ((this._surname != value))
                {
                    this._surname = value;
                }
            }
        }

        public string Name
        {
            get
            {
                return this._name;
            }
            set
            {
                if ((this._name != value))
                {
                    this._name = value;
                }
            }
        }

        public string Middlename
        {
            get
            {
                return this._middlename;
            }
            set
            {
                if ((this._middlename != value))
                {
                    this._middlename = value;
                }
            }
        }

        public string Sex
        {
            get
            {
                return this._sex;
            }
            set
            {
                if ((this._sex != value))
                {
                    this._sex = value;
                }
            }
        }

        public DateTime Birth
        {
            get
            {
                return this._birth;
            }
            set
            {
                if ((this._birth != value))
                {
                    this._birth = value;
                }
            }
        }

        public Address Address
        {
            get
            {
                return this._Address;
            }
            set
            {
                Address previousValue = this._Address;
                if (previousValue != value)
                {
                    
                    this._Address = value;
                   
                }
            }
        }

        public InsurancePolis InsurancePolis
        {
            get
            {
                return this._InsurancePolis;
            }
            set
            {
                InsurancePolis previousValue = this._InsurancePolis;
                if (previousValue != value)
                {
                    
                    this._InsurancePolis = value;
                   
                }
            }
        }

        public override string ToString()
        {
            return String.Format("{0} {1} {2}",Surname, Name, Middlename);
        }
    }
	
}
